package com.lanp.gencode.config;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class JavaCSV {
    /**
     * 入参对象-目前就一个入参
     */
    public static String inParams = "\\$\\{inParams\\}",
    /**
     * 常用example
     */
    example = "\\$\\{example\\}",
    /**
     * 数据库实体对象
     */
    beanName = "\\$\\{beanName\\}",
    /**
     * dto实体对象
     */
    dtoName = "\\$\\{dtoName\\}",
    /**
     * 返回值dto实体对象
     */
    resDtoName = "\\$\\{resDtoName\\}",
    /**
     * 主键名称
     */
    KeyName = "\\$\\{KeyName\\}",
            key_name = "\\$\\{key_name\\}",
    /**
     * mapper对象
     */
    varMapper = "\\$\\{varMapper\\}",
    /**
     * bean的中文昵称
     */
    BeanChineseName = "\\$\\{BeanChineseName\\}",
    /**
     * service对象
     */
    varService = "\\$\\{varService\\}";


    public static String Java_Type_interface = "interface", Java_Type_class = "class";


    public static String serviceApi =
            "package &{PackageUrl};\n" +
                    "\n" +
                    "import java.util.List;\n" +
                    "${ImportList}\n" +
                    "\n" +
                    "\n" +
                    "public interface BeanFileService {\n" +
                    "    /**\n" +
                    "     * 查询列表\n" +
                    "     * @param dtoFile\n" +
                    "     * @return\n" +
                    "     */\n" +
                    "    List<${DtoFile}> findList(${DtoFile} ${dtoFile});\n" +
                    "\n" +
                    "    /**\n" +
                    "     * 查询单个对象\n" +
                    "     * @param dtoFile\n" +
                    "     * @return\n" +
                    "     */\n" +
                    "    ${DtoFile} findOne(${DtoFile} ${dtoFile});\n" +
                    "\n" +
                    "    /**\n" +
                    "     * 根据主键查询单个对象\n" +
                    "     * @param id\n" +
                    "     * @return\n" +
                    "     */\n" +
                    "    ${DtoFile} findById(Long id);\n" +
                    "\n" +
                    "    /**\n" +
                    "     * 编辑单个对象\n" +
                    "     * @param dtoFile\n" +
                    "     * @return\n" +
                    "     */\n" +
                    "    ${DtoFile} edit(${DtoFile} ${dtoFile});\n" +
                    "\n" +
                    "    /**\n" +
                    "     * 删除单个对象\n" +
                    "     * @param dtoFile\n" +
                    "     * @return\n" +
                    "     */\n" +
                    "    ${DtoFile} del(Long id);\n" +
                    "}\n";


    public static void main(String[] args) {
        String input = "2023-12-21T18:19:39.000+00:00";
        DateTimeFormatter formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
        LocalDateTime dateTime = LocalDateTime.parse(input, formatter);ZoneId zone = ZoneId.systemDefault();
        Instant instant = dateTime.atZone(zone).toInstant();
        Date date = Date.from(instant);
        System.out.println(date.getTime());
    }
}
